package cn.gbase.verify;

import org.apache.log4j.PropertyConfigurator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

import cn.gbase.verify.util.Utils;

@SpringBootApplication
public class Application extends SpringBootServletInitializer {
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(Application.class);
	}

	static {
		try {
			// 初始化log4j
			String log4jPath = Application.class.getClassLoader().getResource("").getPath() + "log4j.properties";
			System.out.println("初始化Log4j。。。。");
			System.out.println("path is " +  Application.class.getClassLoader().getResource(""));
			PropertyConfigurator.configure(log4jPath);
			//String path = Utils.logPath();
			//System.setProperty ("log",path);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
 
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
	 
}
